import { IsNotEmpty, IsString, IsInt, IsDate, IsNumber } from 'class-validator';
import { EventStatusEnum, EventTypeEnum } from 'src/common/constant/enums';
import { Category } from 'src/modules/category/entities/category.entity';
import { Stage } from 'src/modules/stage/entities/stage.entity';
import { ApiProperty } from '@nestjs/swagger';

export class CreateEventDto {
  @ApiProperty({ description: '事件Id' })
  @IsNumber()
  id?: number;

  @ApiProperty({ description: '事件名称' })
  @IsNotEmpty()
  @IsString()
  name: string;

  @ApiProperty({ description: '事件类型', enum: EventTypeEnum })
  @IsNotEmpty()
  @IsInt()
  type: EventTypeEnum;

  @ApiProperty({ description: '费用' })
  @IsNotEmpty()
  @IsInt()
  fee: number;

  @ApiProperty({ description: '最少玩家数量' })
  @IsNotEmpty()
  @IsInt()
  minPlayerCount: number;

  @ApiProperty({ description: '最多玩家数量' })
  @IsNotEmpty()
  @IsInt()
  maxPlayerCount: number;

  @ApiProperty({ description: '分类' })
  category: Category;

  @ApiProperty({ description: '阶段列表' })
  stages: Stage[];

  @ApiProperty({ description: '事件状态', enum: EventStatusEnum })
  status: EventStatusEnum;

  // 没啥用
  @ApiProperty({ description: '创建者ID' })
  createBy: number;

  @ApiProperty({ description: '创建时间' })
  createTime: Date;

  @ApiProperty({ description: '更新者ID' })
  updateBy: number;

  @ApiProperty({ description: '更新时间' })
  updateTime: Date;
}